package com.flight.trans.service;

import com.flight.trans.util.LogUtils;

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.handshake.ServerHandshake;

import java.net.URI;

/**
 * author : King
 * date   : 2022/3/417:37
 * desc   :
 */
public class JWebSocketClient extends WebSocketClient {
    public JWebSocketClient(URI serverUri) {
        super(serverUri, new Draft_6455());
    }

    @Override
    public void onOpen(ServerHandshake handshake) {
    }

    @Override
    public void onMessage(String message) {
    }

    @Override
    public void onClose(int code, String reason, boolean remote) {
        LogUtils.e("JWebSocketClient", "已关闭");
    }

    @Override
    public void onError(Exception ex) {
        LogUtils.e("JWebSocketClient", "onError():" + ex.getMessage());
    }
}